UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jhrRP3J7lKnk9p/P1XN6t2jDB+zL+S/5Oo2F8nFqtHU=' 
WHERE 
  key_id = 'ea2c22c3dcfbcb755a992c91ed0ffee51e7e16e230b5bb039cfc61d7008b0014' 
  AND (
    token = 'jhrRP3J7lKnk9p/P1XN6t2jDB+zL+S/5Oo2F8nFqtHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016