UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hf/Mv0E8g+8icDqtC1CeOj/3OSpIqoByZPE7PVjPKrY=' 
WHERE 
  key_id = 'd9e081db53dc5f535baf8228b007c25ae68d04a72f1897450bc2211c756cac1a' 
  AND (
    token = 'hf/Mv0E8g+8icDqtC1CeOj/3OSpIqoByZPE7PVjPKrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031