UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NzekIirvzLgASmRnaxIdNBGSu+ARCCT7OqYRLmn3wpg='
WHERE
key_id = '4ad474ea2a9081830414aeb93cc028c814aac052e1ad7f8781532bf1e4e8d71b'
AND (
token = 'NzekIirvzLgASmRnaxIdNBGSu+ARCCT7OqYRLmn3wpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)