UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jqstDUZiPUcz66Z1tKzMngvP/5fuW7U9p3eWeYB81VI='
WHERE
key_id = '6b989a0f6adc5796bfb49302b943cd5fdab616e74cf70714c7331e0277d995ab'
AND (
token = 'jqstDUZiPUcz66Z1tKzMngvP/5fuW7U9p3eWeYB81VI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)