UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZOR/Giemd6Mjq7m1LYZZiDgfKwNz866mrzw8Vz63J4M='
WHERE
key_id = '3845522a921bf3848fa82bb082448064ccb1be776733c1198ced941f8925bb8a'
AND (
token = 'ZOR/Giemd6Mjq7m1LYZZiDgfKwNz866mrzw8Vz63J4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)