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