UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F2pthScvr/0+Jt+AktTVXzEIuRvvro+2vhjkg346tDI=' 
WHERE 
  key_id = '73d955351fea125909cb2b94e552632da429aecfd02732b3a3af0e0897654fb7' 
  AND (
    token = 'F2pthScvr/0+Jt+AktTVXzEIuRvvro+2vhjkg346tDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030