UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FNXgzqIbsA9+D3Htoh87gpTgMwWRy6npI1CcA/jGtVA='
WHERE
key_id = '101e10cde67df8bf2a581bf7723d072a28a685a3fbb188bb492a1248017435a7'
AND (
token = 'FNXgzqIbsA9+D3Htoh87gpTgMwWRy6npI1CcA/jGtVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)