UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/JvCGCsEmzHOq0zdAMj3OoGvHXo1IGIBz/efVJZ6YuY='
WHERE
key_id = 'd1cd3b4a4fa0f35f40bfaddf5b14029fd097494431a6ef7f5fa22ad24882837c'
AND (
token = '/JvCGCsEmzHOq0zdAMj3OoGvHXo1IGIBz/efVJZ6YuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)