UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fQYAaojM547rWGPQZlpUm9vvoij+Ds08YajxghJP3pQ='
WHERE
key_id = 'c2e3bec5c31de4005284ddb80bfe1ee09034a3c779db89fe15356617d5f52e1d'
AND (
token = 'fQYAaojM547rWGPQZlpUm9vvoij+Ds08YajxghJP3pQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)