UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oz9Cix22PYkFNfNvwEoUHA7LJ5jjP2UcCUxKs67btEA=' 
WHERE 
  key_id = '020c2d9bacc54eec72ec56b2d3ba77253bebe20a176af01aec2810cd015fdf56' 
  AND (
    token = 'Oz9Cix22PYkFNfNvwEoUHA7LJ5jjP2UcCUxKs67btEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049