UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NvL2HSqXpOHNAmti06NEZEP7FrzoZ/sbX8O98jFHfdg=' 
WHERE 
  key_id = 'b0892c5f0fb25a2f5473cfcb6e45397d8b23311ce6fd97941d037b89e498a5f7' 
  AND (
    token = 'NvL2HSqXpOHNAmti06NEZEP7FrzoZ/sbX8O98jFHfdg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042