UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7ml7hYuk/o2lEfygTo2hXtqYLi+l4TcSHEfgY380ks='
WHERE
key_id = 'd4c44a469a2857f20f99a727c4a9625901d5b47ff625d394b19aa04f17f2c14b'
AND (
token = 'n7ml7hYuk/o2lEfygTo2hXtqYLi+l4TcSHEfgY380ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)