UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gxisHU6nIXtHLcDG8qsFNlSs0I4BkH7o0TEdOU49Pe4=' 
WHERE 
  key_id = '411e99023c3940c4f0a7dba337e869c9ba1ec6a420eb71a1c727ca58c8537f1c' 
  AND (
    token = 'gxisHU6nIXtHLcDG8qsFNlSs0I4BkH7o0TEdOU49Pe4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030