UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EVW/ZVLM8jwu0h8q/CO30s+qSHWuPR9X/oAFhngp7c0='
WHERE
key_id = 'bc87b77f770a7994d536a2aa52f8a2dab11cc62477db457d78d362f0fa10476d'
AND (
token = 'EVW/ZVLM8jwu0h8q/CO30s+qSHWuPR9X/oAFhngp7c0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)