UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mmqfsxkHov/qrcK35WRUDC5OlN4Ho4Suda05vc6cBG0=' 
WHERE 
  key_id = '07a6d1d62cbb030c981d6cce351dbd93254d9ce282c8cf3f517bd814f7029abc' 
  AND (
    token = 'mmqfsxkHov/qrcK35WRUDC5OlN4Ho4Suda05vc6cBG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051