UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GuTNXd5Bf3KynU2MAYBCaqs5WGnI/vtZ9a2hLWgcm40='
WHERE
key_id = 'dfa51c420015fb33b8d7bab31da06f182f38a5ffe34da21c456140d016b8de37'
AND (
token = 'GuTNXd5Bf3KynU2MAYBCaqs5WGnI/vtZ9a2hLWgcm40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)