UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8aEx6itvZ/at38gjEqft/AB/e2FjH6iWPvSntlikrYQ=' 
WHERE 
  key_id = '14d63f64f5be60a3a287878db54be782e2bbd7bc31672cad0ff44e308e0ee1a6' 
  AND (
    token = '8aEx6itvZ/at38gjEqft/AB/e2FjH6iWPvSntlikrYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049