UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SoXrtv6FHf4rXRBlheMu7txb7LE5vRDsZgDSb25UWD8=' 
WHERE 
  key_id = '3a30fcf54af63b440052f5d5797ed391e53738cb51328ae0ee6f7d87e9cae5b5' 
  AND (
    token = 'SoXrtv6FHf4rXRBlheMu7txb7LE5vRDsZgDSb25UWD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025