UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j1y8EtmBSNAlA7ofKBFXVQ1DpDpr/Zm6Wo3Dfvd6ogI='
WHERE
key_id = '2b021cd92c8d8ce65884405aea6126ce7dd5b42ec51fd0582a063656291bc275'
AND (
token = 'j1y8EtmBSNAlA7ofKBFXVQ1DpDpr/Zm6Wo3Dfvd6ogI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)