UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Ray9DuBeZcsc1IC5H8g+hI+Jx6jsP0m8r4eW92W5vo=' 
WHERE 
  key_id = '14dfb65bf3151b069ce41cfc8a3170865c5820c6f4480dfd816b60d68e58a59a' 
  AND (
    token = '7Ray9DuBeZcsc1IC5H8g+hI+Jx6jsP0m8r4eW92W5vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040