UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QbRljD64W22cG5nHYQm88iD+eCY6zGGH9LBtYAnXV9I='
WHERE
key_id = '621a67257a71c2828f1561e437ea03001d6a8b70ae38c4d266a4e7c60004ca6a'
AND (
token = 'QbRljD64W22cG5nHYQm88iD+eCY6zGGH9LBtYAnXV9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)