UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yuFJW07tM/NzkpzF1JKfci7WeXhmc6c+S0vxWOYH9TU='
WHERE
key_id = '26b4293b971a9e2c506604294d19a5a9cf791e909ac05117f9a37737d715256e'
AND (
token = 'yuFJW07tM/NzkpzF1JKfci7WeXhmc6c+S0vxWOYH9TU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)