UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9cR/rQzYbcuY0LwCfAkgNPdRpajq8cohtLwxQD7xbr4='
WHERE
key_id = '241c778e522856fa32ac8b0fcf4f07a99c07de8345a1bb865ebbee6c48dd3da1'
AND (
token = '9cR/rQzYbcuY0LwCfAkgNPdRpajq8cohtLwxQD7xbr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)