UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1oYNLubK9cDcOPGJaCk8B5+UVG6I8WR+kBzT5sUj7wI=' 
WHERE 
  key_id = 'ebf49879103446ff86f12b1e677286bb4467e01c8775d76923e03dd6e0a29186' 
  AND (
    token = '1oYNLubK9cDcOPGJaCk8B5+UVG6I8WR+kBzT5sUj7wI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034