UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0VEMKIVLkrAshyx/+zy3fNH8Vw+dCyxy+SnuV6FPf/4=' 
WHERE 
  key_id = '2bd61c7b1730cf7b0055eb968c3723fa984539c948b790c764cf9863c5ac0545' 
  AND (
    token = '0VEMKIVLkrAshyx/+zy3fNH8Vw+dCyxy+SnuV6FPf/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034