UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zkPYaRaGMQIb6zxY0jA7a+iOlcJGVGA0v7iYvtRaPbI='
WHERE
key_id = 'd52e2e4ec41e474ec20929ff4885fbe7cf217e68f02e240cfaacb19d7630d26c'
AND (
token = 'zkPYaRaGMQIb6zxY0jA7a+iOlcJGVGA0v7iYvtRaPbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)