UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NeNO9p5f1TJ0703HpshOW8oRM/q/iDQ24jXK03SjWQg='
WHERE
key_id = '0659c71920d2998c06e1fe6d0261f852c08f3b05a15bd90b0878a77f8dd14fc0'
AND (
token = 'NeNO9p5f1TJ0703HpshOW8oRM/q/iDQ24jXK03SjWQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)