UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8/QWLSatlfr9kR2M7iqApo4sTkmr4JuCR8t4V2uUDlc='
WHERE
key_id = 'e1daa5a525ca61b5148c378c1ca0c2d94c8db0e1cf2d1b4fc7c1ef737488dc2f'
AND (
token = '8/QWLSatlfr9kR2M7iqApo4sTkmr4JuCR8t4V2uUDlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)