UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lRFA/KmijSNruZ9CgzicyORpdrOh+JF1z9Ek/+rzXa0=' 
WHERE 
  key_id = 'f0c80500de93c5e284ac3a0d2d7a9af2264ff5ad41bebdaa950e2ea753c6fd62' 
  AND (
    token = 'lRFA/KmijSNruZ9CgzicyORpdrOh+JF1z9Ek/+rzXa0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032