UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vzagY9OTNJEu0oCgblM5ChKERbHy9YCOjY72MczLQeU=' 
WHERE 
  key_id = '3bee0c956d1135fba16a23cc604886b9a5d1d132d2c7bd80ec943e61c78b78a0' 
  AND (
    token = 'vzagY9OTNJEu0oCgblM5ChKERbHy9YCOjY72MczLQeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020