UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SfzDxRzq9gcF3N6iAw67wm6MM1eRT6/keoHeXM69SqU=' 
WHERE 
  key_id = 'df412222e964e19c026ae0193d4816794f52ed2beaa039c021d363644a841ebc' 
  AND (
    token = 'SfzDxRzq9gcF3N6iAw67wm6MM1eRT6/keoHeXM69SqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025